package com.sky.web.app;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping(value = "/user/category")
public class AppCategoryController {

    @Autowired
    private CategoryService categoryService;

    // 查询首页分类列表
    @GetMapping("/list")
    public Result list(Integer type){
       List<Category> list =  categoryService.findByStatusAndType(type);
       return Result.success(list);
    }
}
